<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
			// super用作函数使用的时候，代表父类的构造函数，ex6规定子类中使用this之前必须先执行super函数
			// super函数相当于People.prototype.constructor.call(this)
			class People{
				constructor(){
					this.maxAge = 100
				}
				// foot(){
				// 	console.log('People eat foot')
				// }
			}
			class Student extends People{
				constructor(){
					super()
					// super.foot()
				}
				setAge(){
					console.log(this.maxAge)
				}
			}
			let xiaoming = new Student()
			xiaoming.setAge()
			
		</script>
	</body>
</html>